@sd-angular/core 19.0.0-beta.25 → 19.0.0-beta.26
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/components/index.d.ts +1 -0
- package/components/view/src/view.component.d.ts +14 -12
- package/fesm2022/sd-angular-core-components-view.mjs +41 -72
- package/fesm2022/sd-angular-core-components-view.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components.mjs +1 -0
- package/fesm2022/sd-angular-core-components.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs +15 -11
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date.mjs +13 -5
- package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-datetime.mjs +14 -10
- package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input-number.mjs +19 -14
- package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input.mjs +15 -11
- package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs +14 -12
- package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
- package/forms/autocomplete/src/autocomplete.component.d.ts +5 -4
- package/forms/date/src/date.component.d.ts +4 -2
- package/forms/datetime/src/datetime.component.d.ts +5 -4
- package/forms/input/src/input.component.d.ts +5 -4
- package/forms/input-number/src/input-number.component.d.ts +7 -6
- package/forms/select/src/select.component.d.ts +5 -4
- package/package.json +75 -75
- package/sd-angular-core-19.0.0-beta.26.tgz +0 -0
- package/utilities/models/src/filter.model.d.ts +10 -2
- package/sd-angular-core-19.0.0-beta.25.tgz +0 -0
package/components/index.d.ts
CHANGED
|
@@ -15,3 +15,4 @@ export * from '@sd-angular/core/components/query-builder';
|
|
|
15
15
|
export * from '@sd-angular/core/components/import-excel';
|
|
16
16
|
export * from '@sd-angular/core/components/document-builder';
|
|
17
17
|
export * from '@sd-angular/core/components/mini-editor';
|
|
18
|
+
export * from '@sd-angular/core/components/view';
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
export declare class SdView {
|
|
4
|
+
label?: string | null;
|
|
5
|
+
value?: string | null;
|
|
6
|
+
display?: string | null;
|
|
7
|
+
hyperlink?: string | null;
|
|
8
|
+
labelTemplate?: TemplateRef<any>;
|
|
9
|
+
valueTemplate?: TemplateRef<any>;
|
|
10
|
+
contentLabelTemplate?: TemplateRef<any>;
|
|
11
|
+
contentValueTemplate?: TemplateRef<any>;
|
|
12
|
+
get activeLabelTemplate(): TemplateRef<any> | undefined;
|
|
13
|
+
get activeValueTemplate(): TemplateRef<any> | undefined;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdView, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdView, "sd-view", never, { "label": { "alias": "label"; "required": false; }; "value": { "alias": "value"; "required": false; }; "display": { "alias": "display"; "required": true; }; "hyperlink": { "alias": "hyperlink"; "required": false; }; "labelTemplate": { "alias": "labelTemplate"; "required": false; }; "valueTemplate": { "alias": "valueTemplate"; "required": false; }; }, {}, ["contentLabelTemplate", "contentValueTemplate"], never, true, never>;
|
|
14
16
|
}
|
|
@@ -1,88 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { ContentChild, Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { SdHrefDirective } from '@sd-angular/core/directives';
|
|
5
|
+
import { SdEmptyPipe } from '@sd-angular/core/pipes';
|
|
4
6
|
|
|
5
|
-
class
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
class SdView {
|
|
8
|
+
label;
|
|
9
|
+
value;
|
|
10
|
+
display;
|
|
11
|
+
hyperlink;
|
|
12
|
+
// 1. Input để hứng template từ component cha (như sd-input, sd-select) truyền xuống
|
|
13
|
+
labelTemplate;
|
|
14
|
+
valueTemplate;
|
|
15
|
+
// 2. ContentChild để bắt trực tiếp nếu Dev dùng thẻ <sd-view> và truyền #sdLabel, #sdValue
|
|
16
|
+
contentLabelTemplate;
|
|
17
|
+
contentValueTemplate; // Đổi tên một xíu cho đồng bộ với label
|
|
18
|
+
// 3. Getter gom template lại: Ưu tiên Input từ cha truyền xuống, không có thì lấy ContentChild
|
|
19
|
+
get activeLabelTemplate() {
|
|
20
|
+
return this.labelTemplate || this.contentLabelTemplate;
|
|
13
21
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this.isUrl = false;
|
|
17
|
-
this.initials = '?';
|
|
18
|
-
this.bgColor = '#bdc3c7';
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
// Kiểm tra xem src có phải là URL (http, https, data:image, hoặc path /)
|
|
22
|
-
const urlPattern = /^(http|https|data:image|\/)/;
|
|
23
|
-
this.isUrl = urlPattern.test(this.src);
|
|
24
|
-
if (!this.isUrl) {
|
|
25
|
-
this.initials = this.#getInitials(this.src);
|
|
26
|
-
this.bgColor = this.#generateColor(this.src);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
handleError() {
|
|
30
|
-
this.src = undefined; // Nếu ảnh lỗi, chuyển sang hiển thị initials
|
|
31
|
-
this.#init();
|
|
22
|
+
get activeValueTemplate() {
|
|
23
|
+
return this.valueTemplate || this.contentValueTemplate;
|
|
32
24
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
.trim()
|
|
36
|
-
.split(' ')
|
|
37
|
-
.map(n => n[0])
|
|
38
|
-
.join('')
|
|
39
|
-
.toUpperCase()
|
|
40
|
-
.substring(0, 2);
|
|
41
|
-
};
|
|
42
|
-
#generateColor = (name) => {
|
|
43
|
-
const colors = [
|
|
44
|
-
'#1abc9c',
|
|
45
|
-
'#2ecc71',
|
|
46
|
-
'#3498db',
|
|
47
|
-
'#9b59b6',
|
|
48
|
-
'#34495e',
|
|
49
|
-
'#16a085',
|
|
50
|
-
'#27ae60',
|
|
51
|
-
'#2980b9',
|
|
52
|
-
'#8e44ad',
|
|
53
|
-
'#2c3e50',
|
|
54
|
-
'#f1c40f',
|
|
55
|
-
'#e67e22',
|
|
56
|
-
'#e74c3c',
|
|
57
|
-
'#95a5a6',
|
|
58
|
-
'#f39c12',
|
|
59
|
-
'#d35400',
|
|
60
|
-
'#c0392b',
|
|
61
|
-
'#bdc3c7',
|
|
62
|
-
'#7f8c8d',
|
|
63
|
-
];
|
|
64
|
-
let hash = 0;
|
|
65
|
-
for (let i = 0; i < name.length; i++) {
|
|
66
|
-
hash = name.charCodeAt(i) + ((hash << 5) - hash);
|
|
67
|
-
}
|
|
68
|
-
return colors[Math.abs(hash) % colors.length];
|
|
69
|
-
};
|
|
70
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdAvatar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
71
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdAvatar, isStandalone: true, selector: "sd-view", inputs: { src: "src", size: "size" }, ngImport: i0, template: "<div class=\"sd-avatar\" [style.width.px]=\"size\" [style.height.px]=\"size\" [style.line-height.px]=\"size\" [style.backgroundColor]=\"bgColor\">\r\n @if (isUrl) {\r\n <img [src]=\"src\" (error)=\"handleError()\" alt=\"avatar\" />\r\n } @else {\r\n <span class=\"sd-avatar-text\" [style.fontSize.px]=\"size / 2.5\">\r\n {{ initials }}\r\n </span>\r\n }\r\n</div>\r\n", styles: [".sd-avatar{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;overflow:hidden;color:#fff;font-weight:500;-webkit-user-select:none;user-select:none;background-size:cover}.sd-avatar img{width:100%;height:100%;object-fit:cover}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
25
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdView, isStandalone: true, selector: "sd-view", inputs: { label: "label", value: "value", display: "display", hyperlink: "hyperlink", labelTemplate: "labelTemplate", valueTemplate: "valueTemplate" }, queries: [{ propertyName: "contentLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true }, { propertyName: "contentValueTemplate", first: true, predicate: ["sdValue"], descendants: true }], ngImport: i0, template: "@if (activeLabelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"activeLabelTemplate\"></ng-container>\r\n} @else {\r\n @if (label) {\r\n <div class=\"T14R text-black400\">{{ label }}</div>\r\n }\r\n}\r\n\r\n@if (activeValueTemplate) {\r\n <ng-container *ngTemplateOutlet=\"activeValueTemplate; context: { $implicit: display, value: value }\"> </ng-container>\r\n} @else {\r\n @if (hyperlink) {\r\n <a [sdHref]=\"hyperlink\">{{ display }}</a>\r\n } @else {\r\n <div class=\"T14M\">{{ display | sdEmpty }}</div>\r\n }\r\n}", dependencies: [{ kind: "pipe", type: SdEmptyPipe, name: "sdEmpty" }, { kind: "directive", type: SdHrefDirective, selector: "a[sdHref]", inputs: ["sdHref"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
72
27
|
}
|
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type:
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdView, decorators: [{
|
|
74
29
|
type: Component,
|
|
75
|
-
args: [{ selector: 'sd-view', standalone: true, imports: [
|
|
76
|
-
}], propDecorators: {
|
|
30
|
+
args: [{ selector: 'sd-view', standalone: true, imports: [SdEmptyPipe, SdHrefDirective, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (activeLabelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"activeLabelTemplate\"></ng-container>\r\n} @else {\r\n @if (label) {\r\n <div class=\"T14R text-black400\">{{ label }}</div>\r\n }\r\n}\r\n\r\n@if (activeValueTemplate) {\r\n <ng-container *ngTemplateOutlet=\"activeValueTemplate; context: { $implicit: display, value: value }\"> </ng-container>\r\n} @else {\r\n @if (hyperlink) {\r\n <a [sdHref]=\"hyperlink\">{{ display }}</a>\r\n } @else {\r\n <div class=\"T14M\">{{ display | sdEmpty }}</div>\r\n }\r\n}" }]
|
|
31
|
+
}], propDecorators: { label: [{
|
|
32
|
+
type: Input
|
|
33
|
+
}], value: [{
|
|
34
|
+
type: Input
|
|
35
|
+
}], display: [{
|
|
77
36
|
type: Input,
|
|
78
37
|
args: [{ required: true }]
|
|
79
|
-
}],
|
|
38
|
+
}], hyperlink: [{
|
|
39
|
+
type: Input
|
|
40
|
+
}], labelTemplate: [{
|
|
41
|
+
type: Input
|
|
42
|
+
}], valueTemplate: [{
|
|
80
43
|
type: Input
|
|
44
|
+
}], contentLabelTemplate: [{
|
|
45
|
+
type: ContentChild,
|
|
46
|
+
args: ['sdLabel']
|
|
47
|
+
}], contentValueTemplate: [{
|
|
48
|
+
type: ContentChild,
|
|
49
|
+
args: ['sdValue']
|
|
81
50
|
}] } });
|
|
82
51
|
|
|
83
52
|
/**
|
|
84
53
|
* Generated bundle index. Do not edit.
|
|
85
54
|
*/
|
|
86
55
|
|
|
87
|
-
export {
|
|
56
|
+
export { SdView };
|
|
88
57
|
//# sourceMappingURL=sd-angular-core-components-view.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-components-view.mjs","sources":["../../../projects/sd-angular/components/view/src/view.component.ts","../../../projects/sd-angular/components/view/src/view.component.html","../../../projects/sd-angular/components/view/sd-angular-core-components-view.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"sd-angular-core-components-view.mjs","sources":["../../../projects/sd-angular/components/view/src/view.component.ts","../../../projects/sd-angular/components/view/src/view.component.html","../../../projects/sd-angular/components/view/sd-angular-core-components-view.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, ContentChild, Input, TemplateRef } from '@angular/core';\r\nimport { SdHrefDirective } from '@sd-angular/core/directives';\r\nimport { SdEmptyPipe } from '@sd-angular/core/pipes';\r\n\r\n@Component({\r\n selector: 'sd-view',\r\n standalone: true,\r\n imports: [SdEmptyPipe, SdHrefDirective, NgTemplateOutlet],\r\n templateUrl: './view.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class SdView {\r\n @Input() label?: string | null;\r\n @Input() value?: string | null;\r\n @Input({ required: true }) display?: string | null;\r\n @Input() hyperlink?: string | null;\r\n\r\n // 1. Input để hứng template từ component cha (như sd-input, sd-select) truyền xuống\r\n @Input() labelTemplate?: TemplateRef<any>;\r\n @Input() valueTemplate?: TemplateRef<any>; \r\n \r\n // 2. ContentChild để bắt trực tiếp nếu Dev dùng thẻ <sd-view> và truyền #sdLabel, #sdValue\r\n @ContentChild('sdLabel') contentLabelTemplate?: TemplateRef<any>;\r\n @ContentChild('sdValue') contentValueTemplate?: TemplateRef<any>; // Đổi tên một xíu cho đồng bộ với label\r\n\r\n // 3. Getter gom template lại: Ưu tiên Input từ cha truyền xuống, không có thì lấy ContentChild\r\n get activeLabelTemplate(): TemplateRef<any> | undefined {\r\n return this.labelTemplate || this.contentLabelTemplate;\r\n }\r\n\r\n get activeValueTemplate(): TemplateRef<any> | undefined {\r\n return this.valueTemplate || this.contentValueTemplate;\r\n }\r\n}","@if (activeLabelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"activeLabelTemplate\"></ng-container>\r\n} @else {\r\n @if (label) {\r\n <div class=\"T14R text-black400\">{{ label }}</div>\r\n }\r\n}\r\n\r\n@if (activeValueTemplate) {\r\n <ng-container *ngTemplateOutlet=\"activeValueTemplate; context: { $implicit: display, value: value }\"> </ng-container>\r\n} @else {\r\n @if (hyperlink) {\r\n <a [sdHref]=\"hyperlink\">{{ display }}</a>\r\n } @else {\r\n <div class=\"T14M\">{{ display | sdEmpty }}</div>\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAYa,MAAM,CAAA;AACR,IAAA,KAAK;AACL,IAAA,KAAK;AACa,IAAA,OAAO;AACzB,IAAA,SAAS;;AAGT,IAAA,aAAa;AACb,IAAA,aAAa;;AAGG,IAAA,oBAAoB;IACpB,oBAAoB,CAAoB;;AAGjE,IAAA,IAAI,mBAAmB,GAAA;AACrB,QAAA,OAAO,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,oBAAoB;IACxD;AAEA,IAAA,IAAI,mBAAmB,GAAA;AACrB,QAAA,OAAO,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,oBAAoB;IACxD;wGArBW,MAAM,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAN,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,MAAM,0aCZnB,4hBAgBC,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EDRW,WAAW,EAAA,IAAA,EAAA,SAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,eAAe,0EAAE,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAI7C,MAAM,EAAA,UAAA,EAAA,CAAA;kBAPlB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,EAAA,UAAA,EACP,IAAI,EAAA,OAAA,EACP,CAAC,WAAW,EAAE,eAAe,EAAE,gBAAgB,CAAC,EAAA,eAAA,EAExC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,4hBAAA,EAAA;8BAGtC,KAAK,EAAA,CAAA;sBAAb;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBAC0B,OAAO,EAAA,CAAA;sBAAjC,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAChB,SAAS,EAAA,CAAA;sBAAjB;gBAGQ,aAAa,EAAA,CAAA;sBAArB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBAGwB,oBAAoB,EAAA,CAAA;sBAA5C,YAAY;uBAAC,SAAS;gBACE,oBAAoB,EAAA,CAAA;sBAA5C,YAAY;uBAAC,SAAS;;;AExBzB;;AAEG;;;;"}
|
|
@@ -15,6 +15,7 @@ export * from '@sd-angular/core/components/query-builder';
|
|
|
15
15
|
export * from '@sd-angular/core/components/import-excel';
|
|
16
16
|
export * from '@sd-angular/core/components/document-builder';
|
|
17
17
|
export * from '@sd-angular/core/components/mini-editor';
|
|
18
|
+
export * from '@sd-angular/core/components/view';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-components.mjs","sources":["../../../projects/sd-angular/components/sd-angular-core-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sd-angular-core-components.mjs","sources":["../../../projects/sd-angular/components/sd-angular-core-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AAEG"}
|
|
@@ -16,13 +16,13 @@ import * as i7 from '@angular/material/progress-spinner';
|
|
|
16
16
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
17
17
|
import * as i4 from '@angular/material/tooltip';
|
|
18
18
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
19
|
-
import { SdItemDefDefDirective,
|
|
19
|
+
import { SdItemDefDefDirective, SdViewDefDirective } from '@sd-angular/core/forms/directives';
|
|
20
20
|
import { SdFormControl, HandleSdCustomValidator, SD_FORM_CONFIGURATION } from '@sd-angular/core/forms/models';
|
|
21
21
|
import { ArrayUtilities, SdUtilities } from '@sd-angular/core/utilities/extensions';
|
|
22
|
+
import { SdView } from '@sd-angular/core/components/view';
|
|
23
|
+
import { SdLabel } from '@sd-angular/core/forms/label';
|
|
22
24
|
import { BehaviorSubject, Subscription, combineLatest, of, defer, from } from 'rxjs';
|
|
23
25
|
import * as uuid from 'uuid';
|
|
24
|
-
import { SdLabel } from '@sd-angular/core/forms/label';
|
|
25
|
-
import { SdEmptyPipe } from '@sd-angular/core/pipes';
|
|
26
26
|
|
|
27
27
|
/* eslint-disable @angular-eslint/component-class-suffix */
|
|
28
28
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -40,6 +40,8 @@ class SdAutocompleteErrotStateMatcher {
|
|
|
40
40
|
class SdAutocomplete {
|
|
41
41
|
ref;
|
|
42
42
|
formConfig;
|
|
43
|
+
sdLabelTemplate;
|
|
44
|
+
sdValueTemplate;
|
|
43
45
|
id = `I${uuid.v4()}`;
|
|
44
46
|
autoId;
|
|
45
47
|
set _autoId(val) {
|
|
@@ -124,7 +126,6 @@ class SdAutocomplete {
|
|
|
124
126
|
this.addable = addable === '' || !!addable;
|
|
125
127
|
}
|
|
126
128
|
itemDef;
|
|
127
|
-
sdLabelDef;
|
|
128
129
|
modelChange = new EventEmitter();
|
|
129
130
|
sdChange = new EventEmitter();
|
|
130
131
|
sdSelection = new EventEmitter();
|
|
@@ -404,7 +405,7 @@ class SdAutocomplete {
|
|
|
404
405
|
};
|
|
405
406
|
}
|
|
406
407
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdAutocomplete, deps: [{ token: i0.ChangeDetectorRef }, { token: SD_FORM_CONFIGURATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
407
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdAutocomplete, isStandalone: true, selector: "sd-autocomplete", inputs: { _autoId: ["autoId", "_autoId"], name: "name", appearance: "appearance", size: "size", form: "form", _label: ["label", "_label"], _helperText: ["helperText", "_helperText"], valueField: "valueField", displayField: "displayField", disabledField: "disabledField", placeholder: "placeholder", items: "items", limit: "limit", cacheChecksum: "cacheChecksum", model: "model", _addable: ["addable", "_addable"], disabled: "disabled", _viewed: ["viewed", "_viewed"], hyperlink: "hyperlink", _required: ["required", "_required"], _validator: ["validator", "_validator"], _inlineError: ["inlineError", "_inlineError"], _hideInlineError: ["hideInlineError", "_hideInlineError"] }, outputs: { modelChange: "modelChange", sdChange: "sdChange", sdSelection: "sdSelection", sdAdd: "sdAdd" }, queries: [{ propertyName: "itemDef", first: true, predicate: SdItemDefDefDirective, descendants: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true }, { propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true }], viewQueries: [{ propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true, read: MatAutocompleteTrigger }, { propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "@if (viewed) {\r\n @if (sdLabelDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef!.templateRef\"> </ng-container>\r\n } @else if (label) {\r\n <div class=\"T14R text-black400\">{{ label }}</div>\r\n }\r\n @if (hyperlink) {\r\n <!-- N\u1EBFu c\u00F3 hyperlink th\u00EC d\u00F9ng th\u1EBB a -->\r\n <a [href]=\"hyperlink\">{{ display | async }}</a>\r\n } @else {\r\n <!-- Ngo\u00E0i ra d\u00F9ng th\u1EBB m\u1EB7c \u0111\u1ECBnh -->\r\n <div class=\"T14M\">{{ display | async | sdEmpty }}</div>\r\n }\r\n} @else {\r\n @if (!appearance && sdLabelDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef?.templateRef!\"> </ng-container>\r\n }\r\n @if (!appearance && label && !sdLabelDef?.templateRef) {\r\n <sd-label [label]=\"label\" [required]=\"required\"></sd-label>\r\n }\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"sdViewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\"\r\n aria-hidden=\"true\">\r\n @if (sdViewDef?.templateRef && !autocompleteTrigger?.panelOpen && !isFocused) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n sdViewDef!.templateRef;\r\n context: {\r\n value: formControl.value,\r\n selectedItem: selected | async,\r\n }\r\n \">\r\n </ng-container>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"size === 'md'\"\r\n [class.sd-sm]=\"size === 'sm'\"\r\n [class.hide-inline-error]=\"hideInlineError\"\r\n [floatLabel]=\"formControl.value ? 'always' : 'auto'\"\r\n [appearance]=\"appearance || 'outline'\">\r\n @if (appearance && label) {\r\n <mat-label style=\"display: inline-block\">\r\n <div style=\"display: flex; align-items: center; gap: 4px\">\r\n <span>{{ label }}</span>\r\n @if (helperText) {\r\n <mat-icon [matTooltip]=\"helperText\" matTooltipPosition=\"below\">info_outline</mat-icon>\r\n }\r\n </div>\r\n </mat-label>\r\n }\r\n <input\r\n [id]=\"id\"\r\n [formControl]=\"inputControl\"\r\n [placeholder]=\"(controlPlaceHolder | async) || ''\"\r\n [class.c-selected]=\"formControl.value\"\r\n [matAutocomplete]=\"auto\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n matInput\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n [required]=\"required\"\r\n #input\r\n #autocompleteTrigger\r\n [attr.data-autoId]=\"autoId\"\r\n aria-hidden=\"true\" />\r\n @if (!loading && formControl.value && !inputControl.disabled) {\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"clear($event)\" matSuffix>cancel</mat-icon>\r\n } @else if (loading) {\r\n <mat-spinner [diameter]=\"20\" matSuffix></mat-spinner>\r\n } @else {\r\n <mat-icon class=\"pointer sd-suffix-icon\" matSuffix>search</mat-icon>\r\n }\r\n <!-- <i [class.d-none]=\"!loading\" class=\"fa fa-spinner fa-pulse c-loading-icon\"></i> -->\r\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onSelect($event.option.value)\" class=\"sd-autocomplete-panel\">\r\n @let items = filteredItems | async;\r\n @if (items?.length) {\r\n <mat-option\r\n *ngFor=\"let item of items\"\r\n [value]=\"item\"\r\n matTooltipPosition=\"above\"\r\n [matTooltip]=\"displayField ? item[displayField] : item\"\r\n [disabled]=\"item[disabledField]\">\r\n <ng-container *ngIf=\"itemDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"itemDef?.templateRef ?? null; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!itemDef?.templateRef\">\r\n {{ displayField ? item[displayField] : item }}\r\n </ng-container>\r\n </mat-option>\r\n } @else if (!items?.length && inputControl.value && !isTyping && !loading) {}\r\n @if (addable && sdAdd.observers.length) {\r\n <mat-option class=\"sd__option--add\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <div (click)=\"onAdd($event)\">\r\n <mat-icon class=\"mr-1\">add</mat-icon>\r\n {{ 'New item' }}\r\n </div>\r\n </mat-option>\r\n }\r\n </mat-autocomplete>\r\n @if (formControl.errors?.['required']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n Vui l\u00F2ng nh\u1EADp th\u00F4ng tin\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['customValidator']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ formControl.errors?.['customValidator'] }}\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n}\r\n", styles: [".text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-light{color:var(--sd-light)!important}.bg-light{background:var(--sd-light)!important}.border-light{border-color:var(--sd-light)!important}.text-dark{color:var(--sd-dark)!important}.bg-dark{background:var(--sd-dark)!important}.border-dark{border-color:var(--sd-dark)!important}.text-black500{color:var(--sd-black500)!important}.bg-black500{background:var(--sd-black500)!important}.border-black500{border-color:var(--sd-black500)!important}.text-black400{color:var(--sd-black400)!important}.bg-black400{background:var(--sd-black400)!important}.border-black400{border-color:var(--sd-black400)!important}.text-black300{color:var(--sd-black300)!important}.bg-black300{background:var(--sd-black300)!important}.border-black300{border-color:var(--sd-black300)!important}.text-black200{color:var(--sd-black200)!important}.bg-black200{background:var(--sd-black200)!important}.border-black200{border-color:var(--sd-black200)!important}.text-black100{color:var(--sd-black100)!important}.bg-black100{background:var(--sd-black100)!important}.border-black100{border-color:var(--sd-black100)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}:host{padding-top:5px;display:block}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field input.c-selected::placeholder{color:#000;opacity:1}:host ::ng-deep .mat-mdc-form-field input.c-selected:-ms-input-placeholder{color:#000}:host ::ng-deep .mat-mdc-form-field input.c-selected::-ms-input-placeholder{color:#000}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled.c-selected::placeholder{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled.c-selected:-ms-input-placeholder{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled.c-selected::-ms-input-placeholder{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}:host ::ng-deep .mat-mdc-form-field:hover .icon-copy{opacity:1}:host ::ng-deep .mat-mdc-form-field .icon-copy{cursor:pointer;width:.9em;height:.9em;fill:#00000080;transition:opacity .2s linear;opacity:0}::ng-deep .sd-autocomplete-panel .mat-mdc-option{min-height:36px!important;height:36px!important;padding-left:12px!important;padding-right:12px!important}::ng-deep .sd-autocomplete-panel .mdc-list-item__primary-text{font-size:14px!important;line-height:normal}::ng-deep .sd-autocomplete-panel .mat-pseudo-checkbox{transform:scale(.75);margin-right:8px!important}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}.sd__option--add{position:sticky;bottom:0;background-color:#fff;z-index:10;color:#000000de;cursor:pointer!important}.c-loading-icon{position:absolute;right:5px;top:5px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i5.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i5.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "pipe", type: SdEmptyPipe, name: "sdEmpty" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
408
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdAutocomplete, isStandalone: true, selector: "sd-autocomplete", inputs: { _autoId: ["autoId", "_autoId"], name: "name", appearance: "appearance", size: "size", form: "form", _label: ["label", "_label"], _helperText: ["helperText", "_helperText"], valueField: "valueField", displayField: "displayField", disabledField: "disabledField", placeholder: "placeholder", items: "items", limit: "limit", cacheChecksum: "cacheChecksum", model: "model", _addable: ["addable", "_addable"], disabled: "disabled", _viewed: ["viewed", "_viewed"], hyperlink: "hyperlink", _required: ["required", "_required"], _validator: ["validator", "_validator"], _inlineError: ["inlineError", "_inlineError"], _hideInlineError: ["hideInlineError", "_hideInlineError"] }, outputs: { modelChange: "modelChange", sdChange: "sdChange", sdSelection: "sdSelection", sdAdd: "sdAdd" }, queries: [{ propertyName: "sdLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true }, { propertyName: "sdValueTemplate", first: true, predicate: ["sdValue"], descendants: true }, { propertyName: "itemDef", first: true, predicate: SdItemDefDefDirective, descendants: true }, { propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true }], viewQueries: [{ propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true, read: MatAutocompleteTrigger }, { propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "@if (viewed) {\r\n <sd-view\r\n [label]=\"label\"\r\n [labelTemplate]=\"sdLabelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"display | async\"\r\n [hyperlink]=\"hyperlink\"\r\n [valueTemplate]=\"sdValueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if (!appearance) {\r\n <ng-content select=\"[sdLabel]\">\r\n @if (label) {\r\n <sd-label [label]=\"label\" [required]=\"required\"></sd-label>\r\n }\r\n </ng-content>\r\n }\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"sdViewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\"\r\n aria-hidden=\"true\">\r\n @if (sdViewDef?.templateRef && !autocompleteTrigger?.panelOpen && !isFocused) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n sdViewDef!.templateRef;\r\n context: {\r\n value: formControl.value,\r\n selectedItem: selected | async,\r\n }\r\n \">\r\n </ng-container>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"size === 'md'\"\r\n [class.sd-sm]=\"size === 'sm'\"\r\n [class.hide-inline-error]=\"hideInlineError\"\r\n [floatLabel]=\"formControl.value ? 'always' : 'auto'\"\r\n [appearance]=\"appearance || 'outline'\">\r\n @if (appearance && label) {\r\n <mat-label style=\"display: inline-block\">\r\n <div style=\"display: flex; align-items: center; gap: 4px\">\r\n <span>{{ label }}</span>\r\n @if (helperText) {\r\n <mat-icon [matTooltip]=\"helperText\" matTooltipPosition=\"below\">info_outline</mat-icon>\r\n }\r\n </div>\r\n </mat-label>\r\n }\r\n <input\r\n [id]=\"id\"\r\n [formControl]=\"inputControl\"\r\n [placeholder]=\"(controlPlaceHolder | async) || ''\"\r\n [class.c-selected]=\"formControl.value\"\r\n [matAutocomplete]=\"auto\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n matInput\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n [required]=\"required\"\r\n #input\r\n #autocompleteTrigger\r\n [attr.data-autoId]=\"autoId\"\r\n aria-hidden=\"true\" />\r\n @if (!loading && formControl.value && !inputControl.disabled) {\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"clear($event)\" matSuffix>cancel</mat-icon>\r\n } @else if (loading) {\r\n <mat-spinner [diameter]=\"20\" matSuffix></mat-spinner>\r\n } @else {\r\n <mat-icon class=\"pointer sd-suffix-icon\" matSuffix>search</mat-icon>\r\n }\r\n <!-- <i [class.d-none]=\"!loading\" class=\"fa fa-spinner fa-pulse c-loading-icon\"></i> -->\r\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onSelect($event.option.value)\" class=\"sd-autocomplete-panel\">\r\n @let items = filteredItems | async;\r\n @if (items?.length) {\r\n <mat-option\r\n *ngFor=\"let item of items\"\r\n [value]=\"item\"\r\n matTooltipPosition=\"above\"\r\n [matTooltip]=\"displayField ? item[displayField] : item\"\r\n [disabled]=\"item[disabledField]\">\r\n <ng-container *ngIf=\"itemDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"itemDef?.templateRef ?? null; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!itemDef?.templateRef\">\r\n {{ displayField ? item[displayField] : item }}\r\n </ng-container>\r\n </mat-option>\r\n } @else if (!items?.length && inputControl.value && !isTyping && !loading) {}\r\n @if (addable && sdAdd.observers.length) {\r\n <mat-option class=\"sd__option--add\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <div (click)=\"onAdd($event)\">\r\n <mat-icon class=\"mr-1\">add</mat-icon>\r\n {{ 'New item' }}\r\n </div>\r\n </mat-option>\r\n }\r\n </mat-autocomplete>\r\n @if (formControl.errors?.['required']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n Vui l\u00F2ng nh\u1EADp th\u00F4ng tin\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['customValidator']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ formControl.errors?.['customValidator'] }}\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n}\r\n", styles: [".text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-light{color:var(--sd-light)!important}.bg-light{background:var(--sd-light)!important}.border-light{border-color:var(--sd-light)!important}.text-dark{color:var(--sd-dark)!important}.bg-dark{background:var(--sd-dark)!important}.border-dark{border-color:var(--sd-dark)!important}.text-black500{color:var(--sd-black500)!important}.bg-black500{background:var(--sd-black500)!important}.border-black500{border-color:var(--sd-black500)!important}.text-black400{color:var(--sd-black400)!important}.bg-black400{background:var(--sd-black400)!important}.border-black400{border-color:var(--sd-black400)!important}.text-black300{color:var(--sd-black300)!important}.bg-black300{background:var(--sd-black300)!important}.border-black300{border-color:var(--sd-black300)!important}.text-black200{color:var(--sd-black200)!important}.bg-black200{background:var(--sd-black200)!important}.border-black200{border-color:var(--sd-black200)!important}.text-black100{color:var(--sd-black100)!important}.bg-black100{background:var(--sd-black100)!important}.border-black100{border-color:var(--sd-black100)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}:host{padding-top:5px;display:block}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field input.c-selected::placeholder{color:#000;opacity:1}:host ::ng-deep .mat-mdc-form-field input.c-selected:-ms-input-placeholder{color:#000}:host ::ng-deep .mat-mdc-form-field input.c-selected::-ms-input-placeholder{color:#000}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled.c-selected::placeholder{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled.c-selected:-ms-input-placeholder{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled.c-selected::-ms-input-placeholder{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}:host ::ng-deep .mat-mdc-form-field:hover .icon-copy{opacity:1}:host ::ng-deep .mat-mdc-form-field .icon-copy{cursor:pointer;width:.9em;height:.9em;fill:#00000080;transition:opacity .2s linear;opacity:0}::ng-deep .sd-autocomplete-panel .mat-mdc-option{min-height:36px!important;height:36px!important;padding-left:12px!important;padding-right:12px!important}::ng-deep .sd-autocomplete-panel .mdc-list-item__primary-text{font-size:14px!important;line-height:normal}::ng-deep .sd-autocomplete-panel .mat-pseudo-checkbox{transform:scale(.75);margin-right:8px!important}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}.sd__option--add{position:sticky;bottom:0;background-color:#fff;z-index:10;color:#000000de;cursor:pointer!important}.c-loading-icon{position:absolute;right:5px;top:5px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i5.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i5.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
408
409
|
}
|
|
409
410
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdAutocomplete, decorators: [{
|
|
410
411
|
type: Component,
|
|
@@ -419,14 +420,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
419
420
|
MatIconModule,
|
|
420
421
|
MatProgressSpinnerModule,
|
|
421
422
|
SdLabel,
|
|
422
|
-
|
|
423
|
-
], template: "@if (viewed) {\r\n @if (sdLabelDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef!.templateRef\"> </ng-container>\r\n } @else if (label) {\r\n <div class=\"T14R text-black400\">{{ label }}</div>\r\n }\r\n @if (hyperlink) {\r\n <!-- N\u1EBFu c\u00F3 hyperlink th\u00EC d\u00F9ng th\u1EBB a -->\r\n <a [href]=\"hyperlink\">{{ display | async }}</a>\r\n } @else {\r\n <!-- Ngo\u00E0i ra d\u00F9ng th\u1EBB m\u1EB7c \u0111\u1ECBnh -->\r\n <div class=\"T14M\">{{ display | async | sdEmpty }}</div>\r\n }\r\n} @else {\r\n @if (!appearance && sdLabelDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef?.templateRef!\"> </ng-container>\r\n }\r\n @if (!appearance && label && !sdLabelDef?.templateRef) {\r\n <sd-label [label]=\"label\" [required]=\"required\"></sd-label>\r\n }\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"sdViewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\"\r\n aria-hidden=\"true\">\r\n @if (sdViewDef?.templateRef && !autocompleteTrigger?.panelOpen && !isFocused) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n sdViewDef!.templateRef;\r\n context: {\r\n value: formControl.value,\r\n selectedItem: selected | async,\r\n }\r\n \">\r\n </ng-container>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"size === 'md'\"\r\n [class.sd-sm]=\"size === 'sm'\"\r\n [class.hide-inline-error]=\"hideInlineError\"\r\n [floatLabel]=\"formControl.value ? 'always' : 'auto'\"\r\n [appearance]=\"appearance || 'outline'\">\r\n @if (appearance && label) {\r\n <mat-label style=\"display: inline-block\">\r\n <div style=\"display: flex; align-items: center; gap: 4px\">\r\n <span>{{ label }}</span>\r\n @if (helperText) {\r\n <mat-icon [matTooltip]=\"helperText\" matTooltipPosition=\"below\">info_outline</mat-icon>\r\n }\r\n </div>\r\n </mat-label>\r\n }\r\n <input\r\n [id]=\"id\"\r\n [formControl]=\"inputControl\"\r\n [placeholder]=\"(controlPlaceHolder | async) || ''\"\r\n [class.c-selected]=\"formControl.value\"\r\n [matAutocomplete]=\"auto\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n matInput\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n [required]=\"required\"\r\n #input\r\n #autocompleteTrigger\r\n [attr.data-autoId]=\"autoId\"\r\n aria-hidden=\"true\" />\r\n @if (!loading && formControl.value && !inputControl.disabled) {\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"clear($event)\" matSuffix>cancel</mat-icon>\r\n } @else if (loading) {\r\n <mat-spinner [diameter]=\"20\" matSuffix></mat-spinner>\r\n } @else {\r\n <mat-icon class=\"pointer sd-suffix-icon\" matSuffix>search</mat-icon>\r\n }\r\n <!-- <i [class.d-none]=\"!loading\" class=\"fa fa-spinner fa-pulse c-loading-icon\"></i> -->\r\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onSelect($event.option.value)\" class=\"sd-autocomplete-panel\">\r\n @let items = filteredItems | async;\r\n @if (items?.length) {\r\n <mat-option\r\n *ngFor=\"let item of items\"\r\n [value]=\"item\"\r\n matTooltipPosition=\"above\"\r\n [matTooltip]=\"displayField ? item[displayField] : item\"\r\n [disabled]=\"item[disabledField]\">\r\n <ng-container *ngIf=\"itemDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"itemDef?.templateRef ?? null; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!itemDef?.templateRef\">\r\n {{ displayField ? item[displayField] : item }}\r\n </ng-container>\r\n </mat-option>\r\n } @else if (!items?.length && inputControl.value && !isTyping && !loading) {}\r\n @if (addable && sdAdd.observers.length) {\r\n <mat-option class=\"sd__option--add\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <div (click)=\"onAdd($event)\">\r\n <mat-icon class=\"mr-1\">add</mat-icon>\r\n {{ 'New item' }}\r\n </div>\r\n </mat-option>\r\n }\r\n </mat-autocomplete>\r\n @if (formControl.errors?.['required']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n Vui l\u00F2ng nh\u1EADp th\u00F4ng tin\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['customValidator']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ formControl.errors?.['customValidator'] }}\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n}\r\n", styles: [".text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-light{color:var(--sd-light)!important}.bg-light{background:var(--sd-light)!important}.border-light{border-color:var(--sd-light)!important}.text-dark{color:var(--sd-dark)!important}.bg-dark{background:var(--sd-dark)!important}.border-dark{border-color:var(--sd-dark)!important}.text-black500{color:var(--sd-black500)!important}.bg-black500{background:var(--sd-black500)!important}.border-black500{border-color:var(--sd-black500)!important}.text-black400{color:var(--sd-black400)!important}.bg-black400{background:var(--sd-black400)!important}.border-black400{border-color:var(--sd-black400)!important}.text-black300{color:var(--sd-black300)!important}.bg-black300{background:var(--sd-black300)!important}.border-black300{border-color:var(--sd-black300)!important}.text-black200{color:var(--sd-black200)!important}.bg-black200{background:var(--sd-black200)!important}.border-black200{border-color:var(--sd-black200)!important}.text-black100{color:var(--sd-black100)!important}.bg-black100{background:var(--sd-black100)!important}.border-black100{border-color:var(--sd-black100)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}:host{padding-top:5px;display:block}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field input.c-selected::placeholder{color:#000;opacity:1}:host ::ng-deep .mat-mdc-form-field input.c-selected:-ms-input-placeholder{color:#000}:host ::ng-deep .mat-mdc-form-field input.c-selected::-ms-input-placeholder{color:#000}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled.c-selected::placeholder{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled.c-selected:-ms-input-placeholder{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled.c-selected::-ms-input-placeholder{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}:host ::ng-deep .mat-mdc-form-field:hover .icon-copy{opacity:1}:host ::ng-deep .mat-mdc-form-field .icon-copy{cursor:pointer;width:.9em;height:.9em;fill:#00000080;transition:opacity .2s linear;opacity:0}::ng-deep .sd-autocomplete-panel .mat-mdc-option{min-height:36px!important;height:36px!important;padding-left:12px!important;padding-right:12px!important}::ng-deep .sd-autocomplete-panel .mdc-list-item__primary-text{font-size:14px!important;line-height:normal}::ng-deep .sd-autocomplete-panel .mat-pseudo-checkbox{transform:scale(.75);margin-right:8px!important}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}.sd__option--add{position:sticky;bottom:0;background-color:#fff;z-index:10;color:#000000de;cursor:pointer!important}.c-loading-icon{position:absolute;right:5px;top:5px}\n"] }]
|
|
423
|
+
SdView
|
|
424
|
+
], template: "@if (viewed) {\r\n <sd-view\r\n [label]=\"label\"\r\n [labelTemplate]=\"sdLabelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"display | async\"\r\n [hyperlink]=\"hyperlink\"\r\n [valueTemplate]=\"sdValueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if (!appearance) {\r\n <ng-content select=\"[sdLabel]\">\r\n @if (label) {\r\n <sd-label [label]=\"label\" [required]=\"required\"></sd-label>\r\n }\r\n </ng-content>\r\n }\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"sdViewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\"\r\n aria-hidden=\"true\">\r\n @if (sdViewDef?.templateRef && !autocompleteTrigger?.panelOpen && !isFocused) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n sdViewDef!.templateRef;\r\n context: {\r\n value: formControl.value,\r\n selectedItem: selected | async,\r\n }\r\n \">\r\n </ng-container>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"size === 'md'\"\r\n [class.sd-sm]=\"size === 'sm'\"\r\n [class.hide-inline-error]=\"hideInlineError\"\r\n [floatLabel]=\"formControl.value ? 'always' : 'auto'\"\r\n [appearance]=\"appearance || 'outline'\">\r\n @if (appearance && label) {\r\n <mat-label style=\"display: inline-block\">\r\n <div style=\"display: flex; align-items: center; gap: 4px\">\r\n <span>{{ label }}</span>\r\n @if (helperText) {\r\n <mat-icon [matTooltip]=\"helperText\" matTooltipPosition=\"below\">info_outline</mat-icon>\r\n }\r\n </div>\r\n </mat-label>\r\n }\r\n <input\r\n [id]=\"id\"\r\n [formControl]=\"inputControl\"\r\n [placeholder]=\"(controlPlaceHolder | async) || ''\"\r\n [class.c-selected]=\"formControl.value\"\r\n [matAutocomplete]=\"auto\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n matInput\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n [required]=\"required\"\r\n #input\r\n #autocompleteTrigger\r\n [attr.data-autoId]=\"autoId\"\r\n aria-hidden=\"true\" />\r\n @if (!loading && formControl.value && !inputControl.disabled) {\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"clear($event)\" matSuffix>cancel</mat-icon>\r\n } @else if (loading) {\r\n <mat-spinner [diameter]=\"20\" matSuffix></mat-spinner>\r\n } @else {\r\n <mat-icon class=\"pointer sd-suffix-icon\" matSuffix>search</mat-icon>\r\n }\r\n <!-- <i [class.d-none]=\"!loading\" class=\"fa fa-spinner fa-pulse c-loading-icon\"></i> -->\r\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onSelect($event.option.value)\" class=\"sd-autocomplete-panel\">\r\n @let items = filteredItems | async;\r\n @if (items?.length) {\r\n <mat-option\r\n *ngFor=\"let item of items\"\r\n [value]=\"item\"\r\n matTooltipPosition=\"above\"\r\n [matTooltip]=\"displayField ? item[displayField] : item\"\r\n [disabled]=\"item[disabledField]\">\r\n <ng-container *ngIf=\"itemDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"itemDef?.templateRef ?? null; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!itemDef?.templateRef\">\r\n {{ displayField ? item[displayField] : item }}\r\n </ng-container>\r\n </mat-option>\r\n } @else if (!items?.length && inputControl.value && !isTyping && !loading) {}\r\n @if (addable && sdAdd.observers.length) {\r\n <mat-option class=\"sd__option--add\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <div (click)=\"onAdd($event)\">\r\n <mat-icon class=\"mr-1\">add</mat-icon>\r\n {{ 'New item' }}\r\n </div>\r\n </mat-option>\r\n }\r\n </mat-autocomplete>\r\n @if (formControl.errors?.['required']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n Vui l\u00F2ng nh\u1EADp th\u00F4ng tin\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['customValidator']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ formControl.errors?.['customValidator'] }}\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n}\r\n", styles: [".text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-light{color:var(--sd-light)!important}.bg-light{background:var(--sd-light)!important}.border-light{border-color:var(--sd-light)!important}.text-dark{color:var(--sd-dark)!important}.bg-dark{background:var(--sd-dark)!important}.border-dark{border-color:var(--sd-dark)!important}.text-black500{color:var(--sd-black500)!important}.bg-black500{background:var(--sd-black500)!important}.border-black500{border-color:var(--sd-black500)!important}.text-black400{color:var(--sd-black400)!important}.bg-black400{background:var(--sd-black400)!important}.border-black400{border-color:var(--sd-black400)!important}.text-black300{color:var(--sd-black300)!important}.bg-black300{background:var(--sd-black300)!important}.border-black300{border-color:var(--sd-black300)!important}.text-black200{color:var(--sd-black200)!important}.bg-black200{background:var(--sd-black200)!important}.border-black200{border-color:var(--sd-black200)!important}.text-black100{color:var(--sd-black100)!important}.bg-black100{background:var(--sd-black100)!important}.border-black100{border-color:var(--sd-black100)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}:host{padding-top:5px;display:block}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field input.c-selected::placeholder{color:#000;opacity:1}:host ::ng-deep .mat-mdc-form-field input.c-selected:-ms-input-placeholder{color:#000}:host ::ng-deep .mat-mdc-form-field input.c-selected::-ms-input-placeholder{color:#000}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled.c-selected::placeholder{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled.c-selected:-ms-input-placeholder{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled.c-selected::-ms-input-placeholder{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}:host ::ng-deep .mat-mdc-form-field:hover .icon-copy{opacity:1}:host ::ng-deep .mat-mdc-form-field .icon-copy{cursor:pointer;width:.9em;height:.9em;fill:#00000080;transition:opacity .2s linear;opacity:0}::ng-deep .sd-autocomplete-panel .mat-mdc-option{min-height:36px!important;height:36px!important;padding-left:12px!important;padding-right:12px!important}::ng-deep .sd-autocomplete-panel .mdc-list-item__primary-text{font-size:14px!important;line-height:normal}::ng-deep .sd-autocomplete-panel .mat-pseudo-checkbox{transform:scale(.75);margin-right:8px!important}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}.sd__option--add{position:sticky;bottom:0;background-color:#fff;z-index:10;color:#000000de;cursor:pointer!important}.c-loading-icon{position:absolute;right:5px;top:5px}\n"] }]
|
|
424
425
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
425
426
|
type: Inject,
|
|
426
427
|
args: [SD_FORM_CONFIGURATION]
|
|
427
428
|
}, {
|
|
428
429
|
type: Optional
|
|
429
|
-
}] }], propDecorators: {
|
|
430
|
+
}] }], propDecorators: { sdLabelTemplate: [{
|
|
431
|
+
type: ContentChild,
|
|
432
|
+
args: ['sdLabel']
|
|
433
|
+
}], sdValueTemplate: [{
|
|
434
|
+
type: ContentChild,
|
|
435
|
+
args: ['sdValue']
|
|
436
|
+
}], _autoId: [{
|
|
430
437
|
type: Input,
|
|
431
438
|
args: ['autoId']
|
|
432
439
|
}], autocompleteTrigger: [{
|
|
@@ -468,9 +475,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
468
475
|
}], itemDef: [{
|
|
469
476
|
type: ContentChild,
|
|
470
477
|
args: [SdItemDefDefDirective]
|
|
471
|
-
}], sdLabelDef: [{
|
|
472
|
-
type: ContentChild,
|
|
473
|
-
args: [SdLabelDefDirective]
|
|
474
478
|
}], modelChange: [{
|
|
475
479
|
type: Output
|
|
476
480
|
}], sdChange: [{
|